<template>
  <div class="success">
    <img :src="require(`../../../../public/img/email/${isTime?'successTime':'mailSuccess'}.png`)" alt="">
    <p>邮件已为您保存至
      <span v-if="!isTime" >[已发送]</span>
      <span v-else >[草稿箱]</span>
    </p>
  </div>
</template>

<script>
    import {mapState} from 'vuex'

    export default {
        name: "success",
        data() {
            return {
                isTime: false,
                result: {},
                target:''
            }
        },
        computed: {
            ...mapState(['common'])
        },
        methods: {
            init(params) {
                this.result = params;
                if (params.name == 'emailListTab') {//收件箱
                    this.target = 'SET_EMAILLISTTAB'
                } else if (params.name == 'emailListUnreadTab') {//未读信箱
                    this.target = 'SET_EMAILLISTUNREADTAB'
                } else if (params.name == 'emailListOutTab') {//已发送箱
                    this.target = 'SET_EMAILLISTOUTTAB'
                }else  if(params.name=='emailListPendingTab'){//待处理
                    this.target = 'SET_EMAILLISTPENDINGTAB'
                }
                this.isTime = this.result.emailSendTiming != '';
            },
        }
    }
</script>

<style lang="scss" >
  .success {
    text-align: center;
    margin-top: 170px;

    p {
      line-height: 34px;
      border-radius: 10px;
      color: #232323;
      margin: 20px auto !important;
      width: 322px;
      background-color: #E9F3FD;

      span {
        color: #2A97F9;
        cursor: pointer;
      }
    }

    .btn {
      button {
        width: 129px;
        text-align: center;
        height: 34px;
        line-height: 34px;
        background: rgba(42, 151, 249, 1);
        border-radius: 10px;
        font-size: 14px;
        padding: 0;
      }
    }
  }
</style>
